bitkeeper revision 1.1159.1.189 (41583f85F6e-ZiwZL5lxbc3U6KIkeQ)
authorkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Mon, 27 Sep 2004 16:27:49 +0000 (16:27 +0000)
committerkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Mon, 27 Sep 2004 16:27:49 +0000 (16:27 +0000)
DOM0 never picks up wallclock time from Xen after initial boot.

linux-2.4.27-xen-sparse/arch/xen/kernel/time.c
linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/time.c

index 924a4a8efe27a46c0a74f87929299af099a89a9c..9257befe87742871f68ca0f29fd7cd12a9bcc698 100644 (file)
@@ -127,7 +127,8 @@ static int __init __independent_wallclock(char *str)
     return 1;
 }
 __setup("independent_wallclock", __independent_wallclock);
-
+#define INDEPENDENT_WALLCLOCK() \
+    (independent_wallclock || (start_info.flags & SIF_INITDOMAIN))
 
 #ifdef CONFIG_XEN_PRIVILEGED_GUEST
 /*
@@ -302,7 +303,7 @@ void do_settimeofday(struct timeval *tv)
     struct timeval newtv;
     suseconds_t usec;
     
-    if ( !independent_wallclock && !(start_info.flags & SIF_INITDOMAIN) )
+    if ( !INDEPENDENT_WALLCLOCK() )
         return;
     
     write_lock_irq(&xtime_lock);
@@ -424,7 +425,7 @@ static inline void do_timer_interrupt(int irq, void *dev_id,
      * synchronised ourselves, and we haven't chosen to keep an independent
      * time base.
      */
-    if ( !independent_wallclock && 
+    if ( !INDEPENDENT_WALLCLOCK() &&
          ((time_status & STA_UNSYNC) != 0) &&
          (xtime.tv_sec > (last_update_from_xen + 60)) )
     {
index 10562570a8c901abc34d69ad213a94bb45f8862c..83b496d338e6f0eb830158946612540138c12278 100644 (file)
@@ -146,6 +146,8 @@ static int __init __independent_wallclock(char *str)
        return 1;
 }
 __setup("independent_wallclock", __independent_wallclock);
+#define INDEPENDENT_WALLCLOCK() \
+    (independent_wallclock || (start_info.flags & SIF_INITDOMAIN))
 
 /*
  * Reads a consistent set of time-base values from Xen, into a shadow data
@@ -260,7 +262,7 @@ int do_settimeofday(struct timespec *tv)
        if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC)
                return -EINVAL;
 
-       if (!independent_wallclock && !(start_info.flags & SIF_INITDOMAIN))
+       if (!INDEPENDENT_WALLCLOCK())
                return 0; /* Silent failure? */
 
        write_seqlock_irq(&xtime_lock);
@@ -392,7 +394,7 @@ static inline void do_timer_interrupt(int irq, void *dev_id,
         * synchronised ourselves, and we haven't chosen to keep an independent
         * time base.
         */
-       if (!independent_wallclock && 
+       if (!INDEPENDENT_WALLCLOCK() &&
            ((time_status & STA_UNSYNC) != 0) &&
            (xtime.tv_sec > (last_update_from_xen + 60))) {
                /* Adjust shadow for jiffies that haven't updated xtime yet. */